
using DomainModel.Domain.Model.MessageAssemblyModel;
using DomainModel.Domain.Model.MessageClipModel;
using DomainModel.Domain.Model.MessageTypeModel;

using DomainModel.Domain.Model.ServiceModel;
using DomainModel.Domain.Model.SubscriptionModel;
using DomainModel.Infrastructure.Persistence;
using DomainModel.Utils;
using MessageTypeDescriber;
using NHibernate;
using Ninject.Modules;

namespace DomainModel.Ninject
{
    public class DataLayerNinjectModule : NinjectModule
    {
        public override void Load()
        {
            Bind<ISessionFactory>().ToConstant(new NHibernateSessionFactory().CreateSessionFactory());
            Bind<ISession>().ToProvider<NHSessionProvider>();

            Bind<IMessageAssembliesRepository>().To<MessageAssembliesRepository>();
            Bind<IServicesRepository>().To<ServicesRepository>();
            Bind<IApplicationConfig>().To<ApplicationConfig>();
            Bind<IMessageTypesRepository>().To<MessageTypesRepository>();
            Bind<ISubscriptionsRepository>().To<SubscriptionsRepository>();
            Bind<IMessageClipsRepository>().To<MessageClipsRepository>();

            Bind<IMd5Hasher>().To<Md5HasherImpl>();
        }
    }
}